package com.airlines.crewassignment.domain.solver;

import java.io.Serializable;
import java.util.Comparator;

import org.apache.commons.lang3.builder.CompareToBuilder;

import com.airlines.crewassignment.domain.CrewPositionAssignment;

/**
 * @author xxxx
 * @date 2018年7月19日 
 * @description
 */
public class CrewPositionAssignmentDifficultyComparator  implements Comparator<CrewPositionAssignment>, Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2990434246330529126L;

	@Override
	public int compare(CrewPositionAssignment c1, CrewPositionAssignment c2) {
		  return new CompareToBuilder()
	                .append(c1.getPosition().getPositionId(),c2.getPosition().getPositionId())
	                .append(c1.getCrew().getWorkcode(),c2.getCrew().getWorkcode())
	                .toComparison();
	}

}
